-
Couldn't load subscription status.
- Fork 447
fix: detect server subfolder in init #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: detect server subfolder in init #566
Conversation
|
Thanks! Are you able to fix the merge conflicts and we can get this shipped 🚀 |
7a3e409 to
514c92d
Compare
|
awesome, glad to hear it @domdomegg! I rebased and fixed the merge conflicts :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Left a small comment 👍
cmd/publisher/commands/init.go
Outdated
| // If we're in a subdirectory, use the current folder name | ||
| if subfolder != "" { | ||
| if cwd, err := os.Getwd(); err == nil { | ||
| folderName := filepath.Base(cwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we use subfolder as a boolean even though it's a string. Wouldn't it be better to reuse the subfolder variable we already have?
For example if it's != "" construct the path using it (and avoid reading the base path again), otherwise proceed as if we are in the root repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're completely right, I pushed a fix
|
Hey! Any update on this? Looks like I got an approval and fixed the comment from the other review so is it ready to be merged? |
Motivation and Context
Discussion from this issue: #538
We want to make it clearer that repo name & server name do not HAVE to be the same, especially in monorepos.
@tadasant this seems like a minor thing that doesn't have to be documented specifically, lmk if you disagree :)
How Has This Been Tested?
Tested the init flow locally, running the built
initcommand from a subfolder and the repo root.Breaking Changes
No
Types of changes
Checklist
Additional context